const express = require('express');
const router = express.Router();
const instructionController = require('../modules/instruction/instructionController');
const warehouseConfig = require('../config/warehouseConfig');

// 指令相关路由
router.get('/instructions/current', instructionController.getCurrentInstructions);
router.get('/instructions/history', instructionController.getHistoryInstructions);
router.post('/instructions', instructionController.createInstruction);
router.put('/instructions/:id/force-post', instructionController.forcePostInstruction);
router.put('/instructions/:id/cancel', instructionController.cancelInstruction);

// 新增：获取仓库配置信息
router.get('/config/warehouse', (req, res) => {
  res.json({
    success: true,
    data: warehouseConfig
  });
});

module.exports = router;